package cn.njyd.corejava.thread.myday02;

class MyThread implements Runnable{
    private int i=0;

    public int getI() {
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    @Override
    public void run() {
        while(true) {
            System.out.println(i++);
        }
    }
}


public class SuspendResumeMethodDemo01 {
    public static void main(String[] args) throws InterruptedException {
        MyThread myThread = new MyThread();
        Thread t = new Thread(myThread);
        t.start();
        Thread.sleep(2000);
        t.suspend();
    }
}
